home *** CD-ROM | disk | FTP | other *** search
- '\" Copyright 1989 Regents of the University of California
- '\" Permission to use, copy, modify, and distribute this
- '\" documentation for any purpose and without fee is hereby
- '\" granted, provided that this notice appears in all copies.
- '\" The University of California makes no representations about
- '\" the suitability of this material for any purpose. It is
- '\" provided "as is" without express or implied warranty.
- '\"
- '\" $Header: /sprite/src/man/dev/RCS/mouse.man,v 1.2 89/06/25 17:11:24 ouster Exp $ SPRITE (Berkeley)
- '/"
- .so \*(]ltmac.sprite
- .HS SCSI dev
- .BS
- '\" Note: do not modify the .SH NAME line immediately below!
- .SH NAME
- scsi \- Devices used to send arbitrary SCSI commands to SCSI devices
- .SH SYNOPSIS
- \fB#include <dev/scsi.h>\fR
- .BE
-
- .SH DESCRIPTION
- .PP
- SCSI devices are used to send arbitrary SCSI commands to SCSI devices.
- The interface uses IO-Controls to pass the SCSI command block and
- command data to the device and return the command status byte,
- command data, and any scsi mode sense data generated.
- The IO-Control \fBIOC_SCSI_COMMAND\fR takes as input a Dev_ScsiCommand
- and returns in the out buffer a Dev_ScsiStatus.
- .DS
- \fCtypedef struct Dev_ScsiCommand {
- int bufferLen;
- int dataOffset;
- int commandLen;
- } Dev_ScsiCommand;\fR
- .DE
- The field \fBbufferLen\fR specifies the length of the command's data
- buffer.
- The data buffer itself is located in the in buffer for commands that
- send data to the device and the out buffer for commands that return
- data. \fBdataOffset\fR specifies the offset into the IO-Control's
- input buffer of the start of the data buffer. If \fBbufferLen\fR is
- greater than zero and the \fBdataOffset\fR equals the size of the
- input buffer then the command is assumed to return data.
- The \fBcommandLen\fR field specifies the number of bytes following
- the Dev_ScsiCommand structure that make up the SCSI command block.
- .DS
- \fCtypedef struct Dev_ScsiStatus {
- int statusByte;
- int amountTransferred;
- int senseDataLen;
- } Dev_ScsiStatus;\fR
- .DE
- The output buffer of the \fBIOC_SCSI_COMMAND\fR command consists of a
- Dev_ScsiStatus followed by any data returned by the device followed by
- any sense data generated by the command.
- The field \fBstatusByte\fR contains the SCSI status byte as returned
- by the SCSI device and the field \fBamountTransferred\fR reports the
- number of data bytes transferred by the command. \fBsenseDataLen\fR
- reports the number of bytes of sense data returned byte the command.
- The out buffer looks like:
- .DS
- Dev_ScsiStatus statusBlock;
- char data[statuBlock.amountTransferred];
- char modeSenseData[statuBlock.senseDataLen];
- .DE
- .SH WARNING
- .PP
- The SCSI command set supported by most devices include some very
- destructive commands such as FORMAT_UNIT and ERASE_TAPE.
- Extreme care should be taken when using this interface.
- .SH KEYWORDS
- scsi command, scsi device, HBA
-